package gererg;

/**
 * @author leon(liangzou0318@gmail.com)
 * @date 2012-4-25
 * @filaname kaoyan_switch.java
 */
public class kaoyan_switch {
          public void switchs(String m[]){
                int t=m.length; 
                int j=t-1;
                for(int i=0; i<t/2;i++,j--){
                	String temp=m[i];
                	m[i]=m[j];
                	m[j]=temp;
                }               
          }
          public void hebing(String a[],String b[],String c[]){
        	  int t=a.length;
        	  for(int i=0;i<a.length;i++){
        		  c[i]=a[i];
        	  }
        	  for(int i=0;i<b.length;i++){
        		  c[t++]=b[i];     		  
        	  }
          }
	public static void main(String[] args) {
		  String a[]={"7","8","9","10","11","1","2","3","4","5","6"};
		  String b[]=new String[5];
		  String c[]=new String[6];
		  for(int i=0;i<5;i++){
			   b[i]= a[i];			  
		  }
		  for(int i=5,j=0;i<a.length;i++,j++){
			   c[j]=a[i];			   
		  }
		  kaoyan_switch kaoyan=new kaoyan_switch();
		  kaoyan.switchs(b);
		  kaoyan.switchs(c);
		  kaoyan.hebing(b, c, a);
		  kaoyan.switchs(a);
		  System.out.print("重新排序如下： ");
		  for(int i=0;i<a.length;i++){
		  System.out.print(" "+a[i]);
		  }
		  }

}
